<template>
  <div class="bar-charts" ref="chart"></div>
</template>

<script>
import * as echarts from 'echarts'
import resize from '@/mixins/resize'
export default {
  name: 'BarChart',
  mixins: [resize],
  mounted() {
    const myEcharts = echarts.init(this.$refs.chart)
    myEcharts.setOption({
      grid: {
        top: 0,
        bottom: 0,
        left: 0,
        right: 0
      },
      xAxis: {
        show: false,
        data: [
          '一月',
          '二月',
          '三月',
          '四月',
          '五月',
          '六月',
          '七月',
          '八月',
          '九月',
          '十月',
          '十一月',
          '十二月'
        ]
      },
      yAxis: {
        show: false
      },
      series: {
        type: 'bar',
        data: [44, 126, 55, 88, 133, 99, 33, 113, 63, 98, 77, 123]
      }
    })
  }
}
</script>

<style lang="scss" scoped>
.bar-charts {
  width: 100%;
  height: 100%;
}
</style>
